//我关注的企业-list
import React, { Component } from 'react';
import {
    Text,
    Image,
    TouchableOpacity,
} from 'react-native';

import { whoseemeStyle as styles } from '../../../../styles';
import fmt from '../../../util/fmtDateUtil';
import {common_url} from "../../../util/fetch";

var Dimensions = require('Dimensions');
var width = Dimensions.get('window').width;
var height = Dimensions.get('window').height;

export default class Whosee_list extends Component {
    constructor(props) {
        super(props);
    }
    render() {
        return (
            <TouchableOpacity
                style={styles.bro_all}
                onPress={() => { this.goGet('Company', this.props.company.companyId); }}
                activeOpacity={1}
            >
                <Image source={
                    this.props.company.company.companyPicture?
                        {uri: common_url + "uploadImg/" + this.props.company.company.companyPicture}
                        : require('../../../img/app/company.png')} style={styles.head} />
                <Text style={[styles.bro_text1, { width: width * 0.6 }]}>
                    {this.props.company.company.companyName}
                </Text>
                <Text style={styles.bro_text2}>{fmt(this.props.company.browseTime, 'yyyy-MM-dd')}</Text>
            </TouchableOpacity>
        )
    }
    goGet(name, id) {
        this.props.navigation.navigate(name, { useId: id });
    }
}